package edu.ahut.corejava3;

import java.io.*;

public class TestIO1 {
    public static void main(String[] args) throws IOException {
        File file=new File("1.txt");
        file.createNewFile();

        FileOutputStream fis=new FileOutputStream("2.txt",true);
        fis.write(97);
        fis.close();

        BufferedOutputStream bos=new BufferedOutputStream(new FileOutputStream("3.txt",true));
        bos.write(new byte[]{97,98,99});
        bos.close();

        BufferedWriter bw=new BufferedWriter(new FileWriter("4.txt",true));
        bw.write("ABC".toCharArray());
        bw.close();

        PrintWriter pw=new PrintWriter(new FileOutputStream("5.txt"),true);
        pw.println("Hello world");
        pw.close();

        bos=new BufferedOutputStream(new BufferedOutputStream(new BufferedOutputStream(new BufferedOutputStream(bos))));

        pw=new PrintWriter(bos);


        Runtime.getRuntime().exec("notepad.exe 6.txt");



    }
}
